/*
 * MIT License
 *
 * Copyright (c) 2018 Aberic Yang
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: block/BlockBody.proto

package cn.aberic.bother.entity.proto.block;

public final class BlockBodyProto {
  private BlockBodyProto() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
  }

  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  public interface BlockBodyOrBuilder extends
      // @@protoc_insertion_point(interface_extends:BlockBody)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * 交易数量
     * </pre>
     *
     * <code>int32 txCount = 1;</code>
     */
    int getTxCount();

    /**
     * <pre>
     * 交易集合
     * </pre>
     *
     * <code>repeated .Transaction transactions = 2;</code>
     */
    java.util.List<TransactionProto.Transaction>
        getTransactionsList();
    /**
     * <pre>
     * 交易集合
     * </pre>
     *
     * <code>repeated .Transaction transactions = 2;</code>
     */
    TransactionProto.Transaction getTransactions(int index);
    /**
     * <pre>
     * 交易集合
     * </pre>
     *
     * <code>repeated .Transaction transactions = 2;</code>
     */
    int getTransactionsCount();
    /**
     * <pre>
     * 交易集合
     * </pre>
     *
     * <code>repeated .Transaction transactions = 2;</code>
     */
    java.util.List<? extends TransactionProto.TransactionOrBuilder>
        getTransactionsOrBuilderList();
    /**
     * <pre>
     * 交易集合
     * </pre>
     *
     * <code>repeated .Transaction transactions = 2;</code>
     */
    TransactionProto.TransactionOrBuilder getTransactionsOrBuilder(
            int index);
  }
  /**
   * Protobuf type {@code BlockBody}
   */
  public  static final class BlockBody extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:BlockBody)
      BlockBodyOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use BlockBody.newBuilder() to construct.
    private BlockBody(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private BlockBody() {
      txCount_ = 0;
      transactions_ = java.util.Collections.emptyList();
    }

    @Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }
    private BlockBody(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 8: {

              txCount_ = input.readInt32();
              break;
            }
            case 18: {
              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                transactions_ = new java.util.ArrayList<TransactionProto.Transaction>();
                mutable_bitField0_ |= 0x00000002;
              }
              transactions_.add(
                  input.readMessage(TransactionProto.Transaction.parser(), extensionRegistry));
              break;
            }
            default: {
              if (!parseUnknownFieldProto3(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
          transactions_ = java.util.Collections.unmodifiableList(transactions_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return BlockBodyProto.internal_static_BlockBody_descriptor;
    }

    @Override
    protected FieldAccessorTable
        internalGetFieldAccessorTable() {
      return BlockBodyProto.internal_static_BlockBody_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              BlockBodyProto.BlockBody.class, BlockBodyProto.BlockBody.Builder.class);
    }

    private int bitField0_;
    public static final int TXCOUNT_FIELD_NUMBER = 1;
    private int txCount_;
    /**
     * <pre>
     * 交易数量
     * </pre>
     *
     * <code>int32 txCount = 1;</code>
     */
    public int getTxCount() {
      return txCount_;
    }

    public static final int TRANSACTIONS_FIELD_NUMBER = 2;
    private java.util.List<TransactionProto.Transaction> transactions_;
    /**
     * <pre>
     * 交易集合
     * </pre>
     *
     * <code>repeated .Transaction transactions = 2;</code>
     */
    public java.util.List<TransactionProto.Transaction> getTransactionsList() {
      return transactions_;
    }
    /**
     * <pre>
     * 交易集合
     * </pre>
     *
     * <code>repeated .Transaction transactions = 2;</code>
     */
    public java.util.List<? extends TransactionProto.TransactionOrBuilder>
        getTransactionsOrBuilderList() {
      return transactions_;
    }
    /**
     * <pre>
     * 交易集合
     * </pre>
     *
     * <code>repeated .Transaction transactions = 2;</code>
     */
    public int getTransactionsCount() {
      return transactions_.size();
    }
    /**
     * <pre>
     * 交易集合
     * </pre>
     *
     * <code>repeated .Transaction transactions = 2;</code>
     */
    public TransactionProto.Transaction getTransactions(int index) {
      return transactions_.get(index);
    }
    /**
     * <pre>
     * 交易集合
     * </pre>
     *
     * <code>repeated .Transaction transactions = 2;</code>
     */
    public TransactionProto.TransactionOrBuilder getTransactionsOrBuilder(
        int index) {
      return transactions_.get(index);
    }

    private byte memoizedIsInitialized = -1;
    @Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (txCount_ != 0) {
        output.writeInt32(1, txCount_);
      }
      for (int i = 0; i < transactions_.size(); i++) {
        output.writeMessage(2, transactions_.get(i));
      }
      unknownFields.writeTo(output);
    }

    @Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (txCount_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(1, txCount_);
      }
      for (int i = 0; i < transactions_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, transactions_.get(i));
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @Override
    public boolean equals(final Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof BlockBodyProto.BlockBody)) {
        return super.equals(obj);
      }
      BlockBodyProto.BlockBody other = (BlockBodyProto.BlockBody) obj;

      boolean result = true;
      result = result && (getTxCount()
          == other.getTxCount());
      result = result && getTransactionsList()
          .equals(other.getTransactionsList());
      result = result && unknownFields.equals(other.unknownFields);
      return result;
    }

    @Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + TXCOUNT_FIELD_NUMBER;
      hash = (53 * hash) + getTxCount();
      if (getTransactionsCount() > 0) {
        hash = (37 * hash) + TRANSACTIONS_FIELD_NUMBER;
        hash = (53 * hash) + getTransactionsList().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static BlockBodyProto.BlockBody parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static BlockBodyProto.BlockBody parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static BlockBodyProto.BlockBody parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static BlockBodyProto.BlockBody parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static BlockBodyProto.BlockBody parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static BlockBodyProto.BlockBody parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static BlockBodyProto.BlockBody parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static BlockBodyProto.BlockBody parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }
    public static BlockBodyProto.BlockBody parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static BlockBodyProto.BlockBody parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static BlockBodyProto.BlockBody parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static BlockBodyProto.BlockBody parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    @Override
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(BlockBodyProto.BlockBody prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    @Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @Override
    protected Builder newBuilderForType(
        BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code BlockBody}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:BlockBody)
        BlockBodyProto.BlockBodyOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return BlockBodyProto.internal_static_BlockBody_descriptor;
      }

      @Override
      protected FieldAccessorTable
          internalGetFieldAccessorTable() {
        return BlockBodyProto.internal_static_BlockBody_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                BlockBodyProto.BlockBody.class, BlockBodyProto.BlockBody.Builder.class);
      }

      // Construct using cn.aberic.bother.entity.proto.block.BlockBodyProto.BlockBody.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
          getTransactionsFieldBuilder();
        }
      }
      @Override
      public Builder clear() {
        super.clear();
        txCount_ = 0;

        if (transactionsBuilder_ == null) {
          transactions_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          transactionsBuilder_.clear();
        }
        return this;
      }

      @Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return BlockBodyProto.internal_static_BlockBody_descriptor;
      }

      @Override
      public BlockBodyProto.BlockBody getDefaultInstanceForType() {
        return BlockBodyProto.BlockBody.getDefaultInstance();
      }

      @Override
      public BlockBodyProto.BlockBody build() {
        BlockBodyProto.BlockBody result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @Override
      public BlockBodyProto.BlockBody buildPartial() {
        BlockBodyProto.BlockBody result = new BlockBodyProto.BlockBody(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        result.txCount_ = txCount_;
        if (transactionsBuilder_ == null) {
          if (((bitField0_ & 0x00000002) == 0x00000002)) {
            transactions_ = java.util.Collections.unmodifiableList(transactions_);
            bitField0_ = (bitField0_ & ~0x00000002);
          }
          result.transactions_ = transactions_;
        } else {
          result.transactions_ = transactionsBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      @Override
      public Builder clone() {
        return (Builder) super.clone();
      }
      @Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      @Override
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      @Override
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      @Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      @Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      @Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof BlockBodyProto.BlockBody) {
          return mergeFrom((BlockBodyProto.BlockBody)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(BlockBodyProto.BlockBody other) {
        if (other == BlockBodyProto.BlockBody.getDefaultInstance()) return this;
        if (other.getTxCount() != 0) {
          setTxCount(other.getTxCount());
        }
        if (transactionsBuilder_ == null) {
          if (!other.transactions_.isEmpty()) {
            if (transactions_.isEmpty()) {
              transactions_ = other.transactions_;
              bitField0_ = (bitField0_ & ~0x00000002);
            } else {
              ensureTransactionsIsMutable();
              transactions_.addAll(other.transactions_);
            }
            onChanged();
          }
        } else {
          if (!other.transactions_.isEmpty()) {
            if (transactionsBuilder_.isEmpty()) {
              transactionsBuilder_.dispose();
              transactionsBuilder_ = null;
              transactions_ = other.transactions_;
              bitField0_ = (bitField0_ & ~0x00000002);
              transactionsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                   getTransactionsFieldBuilder() : null;
            } else {
              transactionsBuilder_.addAllMessages(other.transactions_);
            }
          }
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @Override
      public final boolean isInitialized() {
        return true;
      }

      @Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        BlockBodyProto.BlockBody parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (BlockBodyProto.BlockBody) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private int txCount_ ;
      /**
       * <pre>
       * 交易数量
       * </pre>
       *
       * <code>int32 txCount = 1;</code>
       */
      public int getTxCount() {
        return txCount_;
      }
      /**
       * <pre>
       * 交易数量
       * </pre>
       *
       * <code>int32 txCount = 1;</code>
       */
      public Builder setTxCount(int value) {

        txCount_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * 交易数量
       * </pre>
       *
       * <code>int32 txCount = 1;</code>
       */
      public Builder clearTxCount() {

        txCount_ = 0;
        onChanged();
        return this;
      }

      private java.util.List<TransactionProto.Transaction> transactions_ =
        java.util.Collections.emptyList();
      private void ensureTransactionsIsMutable() {
        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
          transactions_ = new java.util.ArrayList<TransactionProto.Transaction>(transactions_);
          bitField0_ |= 0x00000002;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          TransactionProto.Transaction, TransactionProto.Transaction.Builder, TransactionProto.TransactionOrBuilder> transactionsBuilder_;

      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public java.util.List<TransactionProto.Transaction> getTransactionsList() {
        if (transactionsBuilder_ == null) {
          return java.util.Collections.unmodifiableList(transactions_);
        } else {
          return transactionsBuilder_.getMessageList();
        }
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public int getTransactionsCount() {
        if (transactionsBuilder_ == null) {
          return transactions_.size();
        } else {
          return transactionsBuilder_.getCount();
        }
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public TransactionProto.Transaction getTransactions(int index) {
        if (transactionsBuilder_ == null) {
          return transactions_.get(index);
        } else {
          return transactionsBuilder_.getMessage(index);
        }
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public Builder setTransactions(
          int index, TransactionProto.Transaction value) {
        if (transactionsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTransactionsIsMutable();
          transactions_.set(index, value);
          onChanged();
        } else {
          transactionsBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public Builder setTransactions(
          int index, TransactionProto.Transaction.Builder builderForValue) {
        if (transactionsBuilder_ == null) {
          ensureTransactionsIsMutable();
          transactions_.set(index, builderForValue.build());
          onChanged();
        } else {
          transactionsBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public Builder addTransactions(TransactionProto.Transaction value) {
        if (transactionsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTransactionsIsMutable();
          transactions_.add(value);
          onChanged();
        } else {
          transactionsBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public Builder addTransactions(
          int index, TransactionProto.Transaction value) {
        if (transactionsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTransactionsIsMutable();
          transactions_.add(index, value);
          onChanged();
        } else {
          transactionsBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public Builder addTransactions(
          TransactionProto.Transaction.Builder builderForValue) {
        if (transactionsBuilder_ == null) {
          ensureTransactionsIsMutable();
          transactions_.add(builderForValue.build());
          onChanged();
        } else {
          transactionsBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public Builder addTransactions(
          int index, TransactionProto.Transaction.Builder builderForValue) {
        if (transactionsBuilder_ == null) {
          ensureTransactionsIsMutable();
          transactions_.add(index, builderForValue.build());
          onChanged();
        } else {
          transactionsBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public Builder addAllTransactions(
          Iterable<? extends TransactionProto.Transaction> values) {
        if (transactionsBuilder_ == null) {
          ensureTransactionsIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, transactions_);
          onChanged();
        } else {
          transactionsBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public Builder clearTransactions() {
        if (transactionsBuilder_ == null) {
          transactions_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
          onChanged();
        } else {
          transactionsBuilder_.clear();
        }
        return this;
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public Builder removeTransactions(int index) {
        if (transactionsBuilder_ == null) {
          ensureTransactionsIsMutable();
          transactions_.remove(index);
          onChanged();
        } else {
          transactionsBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public TransactionProto.Transaction.Builder getTransactionsBuilder(
          int index) {
        return getTransactionsFieldBuilder().getBuilder(index);
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public TransactionProto.TransactionOrBuilder getTransactionsOrBuilder(
          int index) {
        if (transactionsBuilder_ == null) {
          return transactions_.get(index);  } else {
          return transactionsBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public java.util.List<? extends TransactionProto.TransactionOrBuilder>
           getTransactionsOrBuilderList() {
        if (transactionsBuilder_ != null) {
          return transactionsBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(transactions_);
        }
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public TransactionProto.Transaction.Builder addTransactionsBuilder() {
        return getTransactionsFieldBuilder().addBuilder(
            TransactionProto.Transaction.getDefaultInstance());
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public TransactionProto.Transaction.Builder addTransactionsBuilder(
          int index) {
        return getTransactionsFieldBuilder().addBuilder(
            index, TransactionProto.Transaction.getDefaultInstance());
      }
      /**
       * <pre>
       * 交易集合
       * </pre>
       *
       * <code>repeated .Transaction transactions = 2;</code>
       */
      public java.util.List<TransactionProto.Transaction.Builder>
           getTransactionsBuilderList() {
        return getTransactionsFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilderV3<
          TransactionProto.Transaction, TransactionProto.Transaction.Builder, TransactionProto.TransactionOrBuilder>
          getTransactionsFieldBuilder() {
        if (transactionsBuilder_ == null) {
          transactionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
              TransactionProto.Transaction, TransactionProto.Transaction.Builder, TransactionProto.TransactionOrBuilder>(
                  transactions_,
                  ((bitField0_ & 0x00000002) == 0x00000002),
                  getParentForChildren(),
                  isClean());
          transactions_ = null;
        }
        return transactionsBuilder_;
      }
      @Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFieldsProto3(unknownFields);
      }

      @Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }


      // @@protoc_insertion_point(builder_scope:BlockBody)
    }

    // @@protoc_insertion_point(class_scope:BlockBody)
    private static final BlockBodyProto.BlockBody DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new BlockBodyProto.BlockBody();
    }

    public static BlockBodyProto.BlockBody getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<BlockBody>
        PARSER = new com.google.protobuf.AbstractParser<BlockBody>() {
      @Override
      public BlockBody parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new BlockBody(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<BlockBody> parser() {
      return PARSER;
    }

    @Override
    public com.google.protobuf.Parser<BlockBody> getParserForType() {
      return PARSER;
    }

    @Override
    public BlockBodyProto.BlockBody getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_BlockBody_descriptor;
  private static final
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_BlockBody_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    String[] descriptorData = {
      "\n\025block/BlockBody.proto\032\027block/Transacti" +
      "on.proto\"@\n\tBlockBody\022\017\n\007txCount\030\001 \001(\005\022\"" +
      "\n\014transactions\030\002 \003(\0132\014.TransactionB5\n#cn" +
      ".aberic.bother.entity.proto.blockB\016Block" +
      "BodyProtob\006proto3"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
          public com.google.protobuf.ExtensionRegistry assignDescriptors(
              com.google.protobuf.Descriptors.FileDescriptor root) {
            descriptor = root;
            return null;
          }
        };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
          TransactionProto.getDescriptor(),
        }, assigner);
    internal_static_BlockBody_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_BlockBody_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_BlockBody_descriptor,
        new String[] { "TxCount", "Transactions", });
    TransactionProto.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}
